package demo1;

import jdk.nashorn.internal.runtime.regexp.joni.exception.SyntaxException;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Objects;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86185
 * Date: 2023-06-02
 * Time: 11:35
 */


 class Main1 {
    public static void main(String[] args) throws ParseException {
        Scanner sc = new Scanner(System.in);
        String s=sc.nextLine();
        SimpleDateFormat d1=new SimpleDateFormat("yyyy MM");
        SimpleDateFormat d2=new SimpleDateFormat("yyyy-MM-dd");

        Calendar cal = Calendar.getInstance();
        cal.setTime(d1.parse(s));

        for(int i=0;i<cal.get(Calendar.DAY_OF_MONTH);i++){
            if(cal.get(Calendar.DAY_OF_WEEK)== Calendar.SUNDAY ||cal.get(Calendar.DAY_OF_WEEK)== Calendar.SATURDAY){
                System.out.println(d2.format(cal.getTime()));
            }
            cal.add(Calendar.DAY_OF_MONTH,1);
        }

    }
}


public class Main {
    public static void main(String[] args) throws ParseException {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy MM");
        SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM-dd");
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(simpleDateFormat.parse(s));

        for (int i = 0; i < calendar.get(Calendar.DAY_OF_MONTH); i++) {
            if (calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY) {
                System.out.println(simpleDateFormat1.format(calendar.getTime()));
            }
            calendar.add(Calendar.DAY_OF_MONTH, 1);
        }
    }
    public static void main5(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        String[] strings = str.split(" ");
        for (int i = 0; i < strings.length; i++) {
            strings[i] = scanner.next();
        }
        int flag = 0;
        for (int i = 0; i < strings.length; i++) {
            if (strings[i].contains(".")) {
                if(flag == 0) {
                    System.out.print("double");
                    flag=1;
                } else {
                    System.out.print(" double");
                }
            } else if(strings[i].contains("true") || strings[i].contains("false")) {
                if(flag == 0) {
                    System.out.print("boolean");
                    flag=1;
                } else {
                    System.out.print(" boolean");
                }
            } else if(Character.isLetter(strings[i].charAt(0))) {
                if(flag == 0) {
                    System.out.print("String");
                    flag=1;
                } else {
                    System.out.print(" String");
                }
            } else {
                if(flag == 0) {
                    System.out.print("int");
                    flag=1;
                } else {
                    System.out.print(" int");
                }
            }
        }
    }
    public static void main4(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        int count1 = 0;
        int count2 = 0;
        int count3 = 0;
        for (char c:
             str.toCharArray()) {
            if(Character.isLetter(c)) {
                if(Character.isLowerCase(c)) {
                    count2++;
                } else {
                    count1++;
                }
            } else {
                count3++;
            }
        }
        System.out.println(count1);
        System.out.println(count2);
        System.out.println(count3);
    }
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str1 = scanner.next();
        String str2 = scanner.next();
        for (int i = 0; i < str1.length(); i++) {
            char c1 = str1.charAt(i);
            char c2 = str2.charAt(str2.length() - i - 1);
            if(c2 != c1) {
                System.out.println("no");
                return;
            }
        }
        System.out.println("yes");
    }
    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        String c = scanner.nextLine();
        String s = scanner.nextLine();
        int count = 0;
        int tmp = str.indexOf(c);
        while(tmp != -1) {
            count++;
            tmp = str.indexOf(c, tmp + c.length());
        }
        System.out.println(count);
        for (int i = str.length() - 1; i >= 0; i--) {
            char t = str.charAt(i);
            System.out.print(t);
        }
        System.out.println();
        tmp = str.indexOf(s);
        int flag = 0;
        while (tmp != -1) {
            if(flag == 0) {
                System.out.print(tmp);
                flag++;
            } else {
                System.out.print(" " + tmp);
            }
            tmp = str.indexOf(s, tmp + s.length());
        }
        System.out.println();
        flag = 0;
        for (int i = 1; i < str.length(); i++) {
            char t = str.charAt(i);
            if(i == 1) {
                if(Character.isLetter(str.charAt(0))) {
                    System.out.print(Character.toUpperCase(str.charAt(0)));
                }
            }
            if(t == ' ') {
                System.out.print(t);
                flag = 1;
            } else {
                if(flag == 1) {
                    System.out.print(Character.toUpperCase(t));
                    flag = 0;
                } else {
                    System.out.print(t);
                }
            }
        }
    }
}
